﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BusinessManagementStudio.Models.BusinessObject.Entities;

namespace BusinessManagementStudio.Models.BusinessLogic
{
    public class ServiceNoComparator : IEqualityComparer<Order>
    {
        public int GetHashCode(Order co)
        {
            if (co == null)
            {
                return 0;
            }
            return co.ServiceOrderNo.GetHashCode();
        }

        public bool Equals(Order x1, Order x2)
        {
            if (object.ReferenceEquals(x1, x2))
            {
                return true;
            }
            if (object.ReferenceEquals(x1, null) ||
                object.ReferenceEquals(x2, null))
            {
                return false;
            }
            return x1.ServiceOrderNo== x2.ServiceOrderNo;
        }
    }
}